Skip to content

fix: audit pass 2 — diagnostic-frame checksum + 8 more findings - #72

Merged
SoundMatt merged 7 commits into
mainfrom
fix/audit-pass-2
Jul 30, 2026
Merged

fix: audit pass 2 — diagnostic-frame checksum + 8 more findings#72
SoundMatt merged 7 commits into
mainfrom
fix/audit-pass-2

Conversation

@SoundMatt

Copy link
Copy Markdown
Owner

Summary

Applies fixes for 8 findings from the second x-Net audit pass (go-LIN-01/02/03/04/05/06/07/09/N2-01 — 9 diffs total, one register line was a test-strengthening companion to another). go-LIN-08 is an advisory (ASIL classification-rule documentation decision) with no diff and is intentionally left open.

  • go-LIN-01 (Critical): master.Node.Diagnostics built a correct classic-checksum Frame for LIN diagnostic frames 0x3C/0x3D but discarded it, re-registering the payload through Bus.Publish, which always applies the enhanced checksum — every diagnostic frame this library emitted was invalid on the wire per ISO 17987 / LIN 2.x §4.2.3. Added a checksum-type-aware Bus.PublishFrame and routed Diagnostics through it.
  • go-LIN-02: the diagnostics round-trip test mirrored the same bug and never asserted checksum type. Strengthened it to assert ChecksumType/Checksum on both frames. Verified by temporarily reverting the go-LIN-01 fix — the strengthened test fails as expected, confirming it actually catches the regression.
  • go-LIN-03: replaced 14 internal uses of the deprecated lin.MaxID/lin.MaxDataLen aliases with LINMaxID/LINMaxDataLen.
  • go-LIN-04: sas.md marked SVP.md/SCMP.md/SQAP.md as absent though all three exist at repo root; corrected evidence table, gap count (6→3), and completeness assertion.
  • go-LIN-05: removed a CONTRIBUTING.md row documenting a nonexistent transport/ directory.
  • go-LIN-06: linNode.Send/virtual.Bus.Publish silently accepted oversize payloads instead of returning the already-defined ErrPayloadTooLarge (RELAY §10.1).
  • go-LIN-07: HARA.md traced SG-02 (checksum safety goal) to REQ-LIN-004 (actually the PID-parity requirement); corrected to REQ-LIN-008/009/010.
  • go-LIN-09: linNode.Send wrapped a malformed frame ID as ErrNotConnected; changed to ErrInvalidFrame for consistency with FromMessage.
  • go-LIN-N2-01: .fusa-hara.json over-rated every hazard's ASIL by one band. Independently recomputed from S/E/C against the standard ISO 26262 Part 3 ASIL determination table (not the diff's own claimed "sum" heuristic) and confirmed the same corrected values: H-01..H-04 → ASIL-A (was ASIL-B), H-05/H-06 → QM (was ASIL-A).

Note: this pass builds on the prior fix pass already on main (sequence-gap bug #57, unmasked CI checks #58, FuSa pin #61) — no overlap or conflicts found with that work.

One residual inconsistency flagged but intentionally not touched here: after this PR, HARA.md's own SG ASIL summary table (lines 36-40) still shows the pre-fix ASIL-B/ASIL-A values, now inconsistent with the corrected .fusa-hara.json. That reconciliation is the subject of the still-open go-LIN-08 advisory (blanket ASIL-B vs. mixed-HARA classification-rule decision) and requires a human policy call, not a diff.

Test plan

  • go build ./...
  • go vet ./...
  • go test ./... (9 test packages, all pass)
  • gofmt -l . clean
  • Verified go-LIN-01/02 by reverting the production fix and confirming the strengthened test fails
  • Independently reverified the go-LIN-N2-01 ASIL recomputation against the ISO 26262 Part 3 determination table

Node.Diagnostics built a correct classic-checksum Frame for 0x3C/0x3D
via req.ToFrame() but then discarded it, re-registering the payload
through lin.Bus.Publish(id, data). virtual.Bus.Publish always applies
the enhanced checksum, so every diagnostic request/response emitted by
Diagnostics carried an invalid (enhanced) checksum on the wire — a
frame the library's own ValidateFrame would reject.

Add a checksum-type-aware PublishFrame(f Frame) to the Bus interface
and virtual.Bus, and have master.Node.Diagnostics register the
fully-formed classic-checksum Frame instead of just its ID/data.

Strengthen TestDiagnostics_requestResponseRoundTrip to assert
ChecksumType and Checksum on both the 0x3C request and the 0x3D
response frames actually placed on the bus, closing the test gap that
let this pass silently (verified by reverting the fix: the
strengthened test fails as expected).

Addresses go-LIN-01 (Critical) and go-LIN-02 (High).

Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
staticcheck ./... reports SA1019 deprecation warnings across
production packages (cmd/lintool, ldf, master, slave) and tests that
still consume the deprecated lin.MaxID/lin.MaxDataLen aliases instead
of LINMaxID/LINMaxDataLen. go vet is clean so CI's vet gate doesn't
catch this class of issue.

Addresses go-LIN-03.

Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
The Software Accomplishment Summary marked SVP.md, SCMP.md, and
SQAP.md as "not found" and asserted 6 gaps / 14/20 evidence items,
though all three files exist at the repo root. Correct the presence
column, gap count/list, and completeness assertion to match actual
repo contents (17/20, 3 remaining gaps).

Addresses go-LIN-04.

Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
The project-structure table listed a transport/ directory (physical-
layer serial/UART abstraction) that does not exist anywhere in the
repo.

Addresses go-LIN-05.

Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
linNode.Send validated only the frame ID and forwarded straight to
bus.Publish, which never checked len(data) against LINMaxDataLen —
RELAY spec section 10.1 requires ErrPayloadTooLarge here, but the
already-defined sentinel was unreachable on this path. Add the length
check to linNode.Send.

Also: an out-of-range/unparseable msg.ID was wrapped as
ErrNotConnected, a connection-state sentinel, for what is a structural
violation. FromMessage already returns ErrInvalidFrame for the same
condition; make Send consistent with it.

Addresses go-LIN-06 and go-LIN-09.

Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
SG-02 ("detect frame payload corruption using the LIN checksum") was
allocated to REQ-LIN-004, which is the PID-parity requirement
(ProtectID carries //fusa:req REQ-LIN-004). The checksum logic
(CalcChecksum) is REQ-LIN-008/009/010; SG-02 traced to the wrong
requirement and to no checksum requirement at all.

Addresses go-LIN-07.

Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
Every hazard's declared asil was one band above what its own
severity/exposure/controllability fields yield under the standard
ISO 26262 Part 3 ASIL determination table: H-01..H-04 (S2/E3/C2)
yield ASIL-A, not the declared ASIL-B; H-05 (S1/E3/C2) and H-06
(S2/E2/C2) yield QM, not the declared ASIL-A. SG-01/02/05 inherited
the inflated ASIL-B from H-01/03 and H-02/04.

Recomputed independently against the standard S/E/C -> ASIL lookup
(not the repo's apparent sum-based shortcut) and confirmed the same
corrected values, so this is a genuine miscalculation, not a
deliberate conservative up-rating.

Note: HARA.md's own SG ASIL summary table (lines 36-40) still shows
the old ASIL-B/ASIL-A values and is now inconsistent with this file;
that document-level reconciliation is tracked separately as an open
item (go-LIN-08) and is out of scope here, which touches only the
machine-readable .fusa-hara.json S/E/C -> ASIL computation.

Addresses go-LIN-N2-01.

Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
@SoundMatt
SoundMatt merged commit 2a958ff into main Jul 30, 2026
14 checks passed
@SoundMatt
SoundMatt deleted the fix/audit-pass-2 branch July 30, 2026 20:59
SoundMatt added a commit that referenced this pull request Jul 30, 2026
Add the CHANGELOG section for the audit fix pass (#72) and update
ROADMAP's release-history table to match.

Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
SoundMatt added a commit that referenced this pull request Jul 30, 2026
go-FuSa v0.48.0 (upstream go-FuSa#89) fixes a critical bug in
hara.DetermineASIL: the hand-written ISO 26262-3:2018 Table 4 lookup was
wrong in 8/12 S2 cells and 11/12 S3 cells, always inflating the ASIL
rating versus the standard's correct additive S+E+C model. It also fixes
a non-reproducible qualify.computeHash (hashed the live timestamp,
didn't sort results before hashing), a git argument-injection risk in
impact.changedFiles, and a CI SARIF self-scan masking bug; a stale
committed check-report.json was removed upstream and a legacy .fusa.json
shape normalized.

Bump all three pin locations (ci.yml's gofusa job, ci.yml's compliance
job, release.yml) to v0.48.0 so they stay identical, per this repo's
established convention (#61).

Verified locally with go-FuSa v0.48.0: full gofusa lifecycle (check/
trace -req-coverage 100/cyber/vuln/trace -sec-tested 100/qualify/verify/
coverage/hara show/boundary/sci/coupling/tara/fmea -cyber -strict/
release/audit-pack) and the compliance job's additional steps
(safety-case/check --output json/all 7 standards gap reports/the
negative-count JSON sanity backstop) all pass cleanly, matching CI
exactly. go-LIN's own dogfooded .fusa-hara.json (H-01..H-06) was already
re-derived under the correct additive model back in #72, so the upstream
ASIL-calculation fix surfaces no drift here: `gofusa hara show` reports
the same ASIL-A/QM classifications as before, with zero gaps beyond the
pre-existing fssrRefs advisories. gofusa cyber still reports the same 28
pre-existing CYBER009 INFO findings (0 error/0 warning) documented in
ci.yml's comments; gofusa qualify still passes 46/46; gofusa fmea -strict
still clears the content-quality gate. iec62443/slsa show a builder-field
GAP when run outside CI (expected — that field is injected by ci.yml's
post-release Python step using GITHUB_* env vars) but pass with 0 GAP
once that step is simulated locally. go build/vet/test/test -race all
green.

No new ERROR/GAP/FAIL findings versus v0.47.1; no fixes required beyond
the pin bump itself.

Signed-off-by: Matt <47545907+SoundMatt@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant